Ext.require(['Ext.data.Store']);
//Ext.require(['Ext.data.JsonStore']);

(function( vvg){
   
   vvg.app =  vvg.app || {};
   var app =  vvg.app;

   app.generateData = function(n, floor){
      var data = [],
          i;
            
      floor = (!floor && floor !== 0)? 20 : floor;
        
      for (i = 0; i < (n || 12); i++) {
         data.push({
            name: Ext.Date.monthNames[i % 12],
            data1: Math.floor(Math.max((Math.random() * 100), floor)),
            data2: Math.floor(Math.max((Math.random() * 100), floor)),
            data3: Math.floor(Math.max((Math.random() * 100), floor)),
            data4: Math.floor(Math.max((Math.random() * 100), floor)),
            data5: Math.floor(Math.max((Math.random() * 100), floor)),
            data6: Math.floor(Math.max((Math.random() * 100), floor)),
            data7: Math.floor(Math.max((Math.random() * 100), floor)),
            data8: Math.floor(Math.max((Math.random() * 100), floor)),
            data9: Math.floor(Math.max((Math.random() * 100), floor))
//            ,nested: {
//               v1: Math.floor(Math.max((Math.random() * 100), floor))
//            }
         });
      }
      return data;
   };

   Ext.define('VVG.store.ChartData', {
      extend: 'Ext.data.Store'
//      extend: 'Ext.data.JsonStore'
//      ,requires: ['Ext.data.JsonStore']
      ,fields: ['name', 'data1', 'data2', 'data3', 'data4', 'data5', 'data6', 'data7', 'data8', 'data9']//, 'nested.v1']
      ,data: app.generateData()
//      ,useSimpleAccessors: false
   });
   
}(window.vvg = window.vvg || {}));
